<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/static/commons/taglibs.jsp"%>
<%@ include file="/static/commons/meta.jsp"%>
<%@ include file="/static/commons/jquery-easyui.jsp"%>
<html >
	 <head>
 		<title>${title }</title>
 		 <link rel="stylesheet" href="${ctx }/static/styles/basic/basic.css" />
		 <link rel="stylesheet" href="${ctx }/static/styles/frame/main.css" />
		 <link rel="stylesheet" href="${ctx }/static/styles/frame/searchBtn.css" />
		 <link rel="stylesheet" href="${ctx }/static/styles/frame/searchCondition.css" />
	    <!-- js -->
 		<script type="text/javascript" src="${ctx}/static/scripts/check_all.js"></script>
 		<script type="text/javascript" src="${ctx}/static/scripts/set_select.js"></script>
 		<script type="text/javascript" src="${ctx}/static/scripts/waiting.js"></script>
 		<script type="text/javascript" src="${ctx}/static/scripts/crud.js"></script>
 		<script type="text/javascript" src="${ctx}/static/scripts/util.js"></script>
		
	</head>
  <body onload="init()">
		<form action="${ctx}/partsOut/list" method="post">
  			<input type="hidden" name="RequestVerificationToken" value="${RequestVerificationToken}" />
			<div class="width_100 group_box">
				<div class="group_search width_100">
					<vvise:select id="custId" name="p_custId" sqlname="getCust" ifSearch="true" displayText="用户单位" />
					<vvise:searchInput id="orderId" name="p_orderId" displayText="订单编号" />
               	 	<div class="clear_both"></div>
				</div>
				<vvise:funMenu menuId="${menuId}" />
			</div>
        </form>
        <div class="listFrame">
        	<iframe name="listFrame" id="listFrame" frameBorder="0"
				scrolling="auto" style="width: 100%;height:100%;"></iframe>
        </div>
	</body>
	<script type="text/javascript">
  		var headers = {};
		headers['__RequestVerificationToken'] = "${RequestVerificationToken}";
			//回车事件
		document.onkeydown = keyKistener;
		function keyKistener(e){
			e = e ? e:event;
			if(e.keyCode == 13){
				try{
					search();
				}catch(e){}
			}
		}
		function init(){
			set_iframe_h();
			$(window).resize(function(){
				set_iframe_h();
			});
			search();
			$('.easyui-combobox').combobox();
		}
		//设置ifream 高度
		function set_iframe_h(){
			var win_height  = $(window).height();
			var func_line_h = $('.group_box').outerHeight(true);
			var list_height = win_height - func_line_h;
			$('.listFrame').css('height',list_height-10);
		}
		function search(){
			waiting();
			document.forms[0].target = "listFrame";
			document.forms[0].submit();
		}
		
		function partsOut(){
			var pp = parent;
			var ecForm = listFrame.document.all.ec;
			if(!checkSelect(ecForm.id,false,'配件确认'))
				return;
			var id = get_checkbox_value(ecForm.id);
			var ids = id.split('@@');
			if(ids[1]==ids[2]){
				 pp.$.messager.alert('操作提示',"不可重复操作！","info");
				 return;
			}
			
			id = ids[0];
			pp.openWindow("配件出库",pp.width3+332, 360, "${ctx}/partsOut/edit?p_orderId="+id,[{
				text:'确认出库',
				iconCls:'icon-ok',
				handler:function(){
					doSave("${ctx}/partsOut/save?orderId="+id, '');
				}
			},{
				text:'取消',
				iconCls:'icon-no',
				handler:function(){
					pp.closeWindow();
				}
			}]);
		}
		
		function view(orderId){
			var pp = parent;
			doView("配件出库",pp.width3+332, 360, "${ctx}/partsOut/edit?view=view&p_orderId="+orderId);
		}
		</script>
</html>